package org.whuims.insapplication.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import org.whuims.insapplication.bean.BelongTo;
import org.whuims.insapplication.service.BelongToService;

import javax.annotation.Resource;

    /**
     * Created by unclewang on 2017/5/25.
     */
    @Controller
    @RequestMapping("/")
    public class BelongToController {
        @Resource
        private BelongToService belongToService;

        @GetMapping
        public ModelAndView list(){
            Iterable<BelongTo> belongTos=belongToService.getall();
            System.out.println(belongTos.toString());
            return new ModelAndView("html/list","belongtos",belongTos);
        }

}

